package com.carSys.Controller;

import com.carSys.DTO.OAACountsByRepairmanDTO;
import com.carSys.DTO.OAACountsByTaskTypeDTO;
import com.carSys.DTO.OAACountsByVehicleDTO;
import com.carSys.Service.OAACountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/carsys/oaacount")
public class OAACountController {
    @Autowired
    private OAACountService oaacountService;

    @GetMapping("/getOAACountByTaskType")
    public List<OAACountsByTaskTypeDTO> getOAACountByTaskType() {
        return oaacountService.getUnCompletedOAACountsSortedByTaskType();
    }

    @GetMapping("/getOAACountByRepairman")
    public List<OAACountsByRepairmanDTO> getOAACountByRepairman() {
        return oaacountService.getUnCompletedOAACountsSortedByRepairPerson();
    }

    @GetMapping("/getOAACountByVehicle")
    public List<OAACountsByVehicleDTO> getOAACountByVehicle() {
        return oaacountService.getUnCompletedOAACountsSortedByVehicle();
    }
}
